/*****************************************************************************
 * Copyright (C) Stacy Curl. All rights reserved.                            *
 * ------------------------------------------------------------------------- *
 * The software in this package is published under the terms of the BSD      *
 * style license a copy of which has been included with this distribution in *
 * the LICENSE.txt file.                                                     *
 *****************************************************************************/
package picounit.features.failures_first;

import previous.picounit.Test;
import previous.picounit.Verify;

public class ProblemCountTest implements Test {
	public static class ClassA {}

	private final ProblemCount classANoProblems = new ProblemCount(ClassA.class, 0, 0);
	private final ProblemCount classBOneFailure = new ProblemCount(ClassA.class, 0, 1);
	private final ProblemCount classBOneError = new ProblemCount(ClassA.class, 1, 0);

	public void testCountWithFailuresBeforeCountWithout(Verify verify) {
		verify.that(classBOneFailure.compareTo(classANoProblems))
			.isLessThan(0);
		
		verify.that(classANoProblems.compareTo(classBOneFailure))
			.isGreaterThan(0);
	}

	public void testCountWithErrorsBeforeCountWithout(Verify verify) {
		verify.that(classBOneError.compareTo(classANoProblems))
			.isLessThan(0);
		
		verify.that(classANoProblems.compareTo(classBOneError))
			.isGreaterThan(0);
	}
	
	public void testCountWithErrorsBeforeCountWithFailures(Verify verify) {
		verify.that(classBOneError.compareTo(classBOneFailure))
			.isLessThan(0);

		verify.that(classBOneFailure.compareTo(classBOneError))
			.isGreaterThan(0);
	}
}
